function changeSkin(value) {
		Ext.util.CSS.swapStyleSheet('window',basePath+'ext/resources/css/'+value+'.css');
};
Ext.onReady(function(){
	var tabs = new Ext.TabPanel({
                    region:'center',
                    deferredRender:false,
                    enableTabScroll:true,
                    minTabWidth: 115,
                    activeTab:0,
                    //plugins: new Ext.ux.TabCloseMenu(),
                    items:[
                    	{
                        contentEl:'wksp',
                        title: text_tab_workspace,
                        style:'margin:5px;',
                        layout:'column',
                        autoScroll:true
                    }
//                    ,{
//                        contentEl:'dbsy',
//                        title: text_tab_dbsy,
//                        style:'margin:5px;',
//                        layout:'column',
//                        autoScroll:true,
//                        closable:true,
//                        html:'<iframe id="if_dbsy" src="'+text_tab_dbsy_url+'" height="99%" width="99%" frameborder="0" scrolling="auto"></iframe>'
//                    },{
//                        contentEl:'bmlt',
//                        title: text_tab_bmlt,
//                        style:'margin:5px;',
//                        layout:'column',
//                        autoScroll:true,
//                        closable:true,
//                        html:'<iframe id="if_dbsy" src="'+text_tab_bmlt_url+'" height="99%" width="99%" frameborder="0" scrolling="auto"></iframe>'
//                    }
                    ]
      });
      var dwfz_root = new Ext.tree.AsyncTreeNode({text:text_dwfz});
      var tree = new Ext.tree.TreePanel({
                        id:'im-tree',
                        title: text_dwfz,
                        loader: new Ext.tree.TreeLoader({dataUrl:basePath+'inc/dwfz.json'}),
                        rootVisible:true,
                        lines:false,
                        iconCls:'nav',
                        autoScroll:true,
                        root: dwfz_root
        });
       dwfz_root.expand();
       tree.on('click',function(node,e){
       		/*
       		tabs.add({
	            title: node.text,
	            id:'workspace',
	            //iconCls: 'tabs',
	            html: '<iframe src="login.jsp?link='+node.link
	            			+'" width="100%" height="100%"></iframe>',
	            closable:true
	        }).show();
	        */
       		tabs.setActiveTab(0);
       		Ext.getCmp('main_viewport').getComponent('west-panel').collapse();

       	});
       	var zhgh_root = new Ext.tree.AsyncTreeNode({text:text_zhgh});
      	var zhgh_tree = new Ext.tree.TreePanel({
	                        id:'zhgh-tree',
	                        title: text_zhgh,
	                        loader: new Ext.tree.TreeLoader({dataUrl:basePath+'inc/dwfz.json'}),
	                        rootVisible:true,
	                        lines:false,
	                        iconCls:'nav',
	                        autoScroll:true,
	                        root: zhgh_root
	        });
	       zhgh_root.expand();
	       zhgh_tree.on('click',function(node,e){
	       		tabs.setActiveTab(0);
	       	});
     
      var viewport = new Ext.Viewport({
             layout:'border',
             id:'main_viewport',
             items:[
                new Ext.BoxComponent({ 
                    region:'north',
                    el: 'north',
                    height:75
                }),{
                    region:'west',
                    id:'west-panel',
                    title:text_menu_title,
                    split:true,
                    width: 200,
                    minSize: 175,
                    maxSize: 400,
                    collapsible: true,
                    margins:'0 0 0 5',
                    layout:'accordion',
                    layoutConfig:{
                        animate:true
                    },
                    items: [tree,zhgh_tree,{
                        title:text_zhjh,
                        html:'<p>Some settings in here.</p>',
                        border:false,
                        iconCls:'settings'
                    }]
                },tabs
             ]
        });
        var tb = new Ext.Toolbar();
    	tb.render('menu-tb');
    	
		tb.add('-',{
            text:'首页',
            iconCls: 'bmenu'  // <-- icon
        },'-',{
            text:'测试',
            iconCls: 'blist'  // <-- icon
        },'->',
        new Ext.menu.TextItem(text_logininfo));
		
});
